<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('企业实时评价结果')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p style="width:98px">关键字：</p>
                                <input type="text" name="keyword"/>
                            </li>
                            <li>
                                                                             资质分类：<select name="evaluationObject" th:with="type=${@dict.getType('sys_normal_disable')}">
                                        <option value="">全部</option>                                     
							            <option value="房屋建筑工程|施工总承包">房屋建筑工程施工总承包资质</option>
										<option value="市政公用工程|施工总承包">市政公用工程施工总承包资质</option>
										<option value="房屋建筑工程|工程监理专业资质">房屋建筑工程工程监理专业资质</option>
										<option value="市政公用工程|工程监理专业资质">市政公用工程工程监理专业资质</option>
										<option value="检测机构">检测机构</option>
										<option value="混凝土生产企业">混凝土生产企业</option>
										<option value="工程造价咨询企业">工程造价咨询企业</option>
										<option value="工程招标代理机构">工程招标代理机构</option>
										<option value="建设单位">建设单位</option>
								   </select>
                            </li>
                            <li>
                                                                             是否为最新一期：<select name="isOld" th:with="type=${@dict.getType('sys_normal_disable')}">
                                        <option value="0">是</option>                                     
							            <option value="1">否</option>
										<option value="">不限</option>
								   </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                 <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:src="@{/js/plugins/datetime/moment.js}"></script>
    <script th:inline="javascript">
    var prefix = ctx + "integrityEvaluation/enterprises";
    var enterprisesPrefix = ctx + "enterprise/enterprise";
    
    $(function() {
    	 var options = {
    			url: prefix + "/enterprisesStageList",
                detailUrl: enterprisesPrefix + "/detail/{id}",
                modalName: "企业阶段评价",
                columns: [{
	                        field: 'id',
	                        title: '序号',
							formatter: function (value, row, index) {
							
							    return index + 1;
							}
                    	}, 
						{
	                        field: 'guid',
	                        title: '标识符',
							visible: false
	                    }, 
						{
	                        field: 'companyGuid',
	                        title: '企业标识符',
							visible: false
	                    }, 
						{
                        field: 'companyName',
                        title: '企业名称',
                        formatter: function (value, row, index) {
                            var actions = [];
                            actions.push('<a href="javascript:void(0)" onclick="$.operate.detailQYTabRewrite(\'' + row.companyGuid + '\',\'' + value + '\')">'+value+'</a>');
                            return actions.join('');
                        }
                    }, 
					{
                        field: 'orgCode',
                        title: '组织机构代码\统一社会信用代码'
                    }, 
					{
                        field: 'evaluationObject',
                        title: '资质分类'
                    }, 
					{
                        field: 'avgScore',
                        title: '阶段平均分',
						formatter: function (value, row, index) {
							value = Number(value).toFixed(2);
							return value;
						}
                    }, 
					{
                        field: 'level',
                        title: '阶段诚信等级'
                    },
                    {
                        field: 'pubDate',
                        title: '评价日期',
						formatter: function (value, row, index) {
							if($.common.isNotEmpty(value)){
								var strDate = value;
								value =  moment(strDate,'YYYY-MM-DD').format('YYYY-MM-DD');	
							}
							return value;
						}
                    }]
        };
    	$.table.init(options);
    });
    </script>
</body>
</html>